<%@include file="/other/Header.jsp"%>
<jsp:directive.page import="java.sql.*" />
<jsp:directive.page import="Connectivity.ConnectionManager" />
<%
			String cust_id = request.getParameter("cust_id") != null ? request
			.getParameter("cust_id") : "null";
	String status = request.getParameter("status") != null ? request
			.getParameter("status") : "BACK";
	String flag = request.getParameter("flag") != null ? request
			.getParameter("flag") : "";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
   "http://www.w3.org/TR/html4/loose.dtd">

<html>

	<head>
		<meta http-equiv="Content-Type"
			content="text/html; charset=windows-1256">
		<title>Customer Registration</title>
	</head>
	


	<body bgcolor="white">






		<form name=custdetails method=get
			action="/Genius/CustomerServlet?flag=2">
			<table align=center border=1>
				<%
						if (flag.equalsIgnoreCase("I")) {
						out
						.println("  <tr><td align=center width=100% colspan=10><font size=4 color=black> INSERTED SUCCESSFULLY </font> </td></tr>");
					}
					if (flag.equalsIgnoreCase("U")) {
						out
						.println("  <tr><td align=center width=100% colspan=10><font size=4 color=black> UPDATED SUCCESSFULLY </font> </td></tr>");
					}
					if (flag.equalsIgnoreCase("D")) {
						out
						.println("  <tr><td align=center width=100% colspan=10><font size=4 color=black> DELETED SUCCESSFULLY </font> </td></tr>");
					}
				%>
				<%
					String read = "readonly=readonly";
					String label_heading = "CLIENT DETAILS";
					if (status.equalsIgnoreCase("UPDATE")) {
						read = "";
						label_heading = "CLIENT DETAILS UPDATION";
					}

					String customerquerry = "select customer_id,customer_name,area,phone_no1,phone_no2,mobile_no,email_id,address1";
					customerquerry = customerquerry
							+ ",contactperson1,mobilecontact1,contactperson2,mobilecontact2 ";
					customerquerry = customerquerry
							+ " from customer_master  where customer_id='" + cust_id
							+ "' and status='V'";
					prst1 = con.prepareStatement("" + customerquerry);
					ResultSet rs1 = prst1.executeQuery();
					while (rs1.next()) {

						// (customer_id,customer_name,address1,phone_no1,phone_no2,mobile_no,email_id";
						//	query=query+",contactperson1,contactperson2,mobilecontact1,mobilecontact2, currency_symbol";
						//		query=query+",created_by,area,status)
				%>

				<tr>
					<td align=center colspan=10>
						<font size=6 color=Blue> <%=label_heading%> </font>
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						CLIENT ID:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=label name=custId readonly=readonly
							value="<%=rs1.getString(1).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						CLIENT NAME:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=name name=name <%=read%>
							value="<%=rs1.getString(2).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						BRANCH/AREA:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text name=branch <%=read%>
							value="<%=rs1.getString(3).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						PHONE NO:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text name=telephone1 <%=read%> size=12
							value="<%=rs1.getString(4).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						ALTERNATE PHONE NO.:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text name=telephone2 <%=read%> size=12
							value="<%=rs1.getString(5).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						MOBILE NO:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text maxlength=10 name=mobileno <%=read%> size=10
							value="<%=rs1.getString(6).toUpperCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						EMAILID:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<INPUT maxLength=100 size=30 name=email <%=read%>
							value="<%=rs1.getString(7).toLowerCase()%>">
					</td>
				</tr>
				<tr>
					<td align=left colspan=5>
						ADDRESS:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<TEXTAREA rows=3 cols=25 <%=read%> name=address>
							<%=rs1.getString(8).toUpperCase()%>
						</TEXTAREA>
					</td>
				</tr>
				<!--   <TR> <TD align=right><INPUT   onclick=displayRow(this) value=CLIENT1 type=radio name=CLIENT1>CLIENT 1</TD>
     <TD align=left><INPUT onclick=displayRow(this)  value=CLIENT2  type=radio name=CLIENT2>CLIENT 2</TD>
 </TR>-->

				<TR>
					<td align=left colspan=5>
						CONTACT PERSON 1/ MANAGER:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text name=cust1 <%=read%>
							value="<%=rs1.getString(9).toUpperCase()%>">
					</td>
				</tr>
				<TR>
					<td align=left colspan=5>
						MOBILE NO OF CONTACT PERSON1:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input size=10 maxlength=10 type=text name=cust1mobile <%=read%>
							value="<%=rs1.getString(10).toUpperCase()%>">
					</td>
				</tr>

				<TR>
					<td align=left colspan=5>
						CONTACT PERSON 2/ ACCOUNTANT:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input type=text name=cust2 <%=read%>
							value="<%=rs1.getString(11).toUpperCase()%>">
					</td>
				</tr>
				<TR>
					<td align=left colspan=5>
						MOBILE NO OF CONTACT PERSON2:&nbsp;&nbsp;&nbsp;
					</td>
					<td align=left colspan=5>
						<input size=10 maxlength=10 <%=read%> type=text name=cust2mobile
							value="<%=rs1.getString(12).toUpperCase()%>">
					</td>
				</tr>

				<tr>
					<td align=center colspan=10>
						<input type=submit name=submit value="<%=status%>"
							onclick="return Validate();">
						&nbsp;&nbsp;&nbsp;&nbsp
				</tr>




				<%
				}
				%>

			</table>
		</form>



	</body>

</html>
